package view;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Acessa
 */
public class FrmCadastroProduto extends javax.swing.JFrame {

    private static FrmCadastroProduto _instance = null;
    
    public static synchronized FrmCadastroProduto getInstance() {
        if(_instance == null) {
            _instance = new FrmCadastroProduto();
        }
        return _instance;
    }
    
    /**
     * Creates new form FrmCadastroProduto
     */
    private FrmCadastroProduto() {
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        tbrAdcDelSalvarProd = new javax.swing.JToolBar();
        btnAdcProd = new javax.swing.JButton();
        btnDelProd = new javax.swing.JButton();
        btnSalvarProd = new javax.swing.JButton();
        lblCodProd = new javax.swing.JLabel();
        lblDescProd = new javax.swing.JLabel();
        lblQtdEstoqueProd = new javax.swing.JLabel();
        lblPrecoProd = new javax.swing.JLabel();
        tfdCodProd = new javax.swing.JTextField();
        tfdDescProd = new javax.swing.JTextField();
        tfdQtdEstoqueProd = new javax.swing.JTextField();
        ftfPrecoProd = new javax.swing.JFormattedTextField();
        pnlControlesProd = new javax.swing.JPanel();
        btnVoltarInicioProd = new javax.swing.JButton();
        pnlBtnVoltarProd = new javax.swing.JPanel();
        btnVoltarProd = new javax.swing.JButton();
        lblContador1Prod = new javax.swing.JLabel();
        pnlSecundarioControlesProd = new javax.swing.JPanel();
        btnContador2Prod = new javax.swing.JLabel();
        btnContador3Prod = new javax.swing.JLabel();
        btnSeguirProd = new javax.swing.JButton();
        btnUltimoProd = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Cadastrar Produtos");

        tbrAdcDelSalvarProd.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        tbrAdcDelSalvarProd.setRollover(true);

        btnAdcProd.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/img/add-2-icon (2).png"))); // NOI18N
        btnAdcProd.setFocusable(false);
        btnAdcProd.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        tbrAdcDelSalvarProd.add(btnAdcProd);

        btnDelProd.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/img/delete-icon.png"))); // NOI18N
        btnDelProd.setFocusable(false);
        btnDelProd.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        tbrAdcDelSalvarProd.add(btnDelProd);

        btnSalvarProd.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/img/basic-data-icon.png"))); // NOI18N
        btnSalvarProd.setFocusable(false);
        btnSalvarProd.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        tbrAdcDelSalvarProd.add(btnSalvarProd);

        lblCodProd.setText("CÓDIGO:");

        lblDescProd.setText("DESCRIÇÃO:");

        lblQtdEstoqueProd.setText("QUANTIDADE EM ESTOQUE:");

        lblPrecoProd.setText("PREÇO DE VENDA:");

        tfdCodProd.setEditable(false);
        tfdCodProd.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
        tfdCodProd.setText("1");

        ftfPrecoProd.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("R¤#,##0"))));
        ftfPrecoProd.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        ftfPrecoProd.setText("R$0000,00");

        pnlControlesProd.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 0, 0), 1, true));

        btnVoltarInicioProd.setText("|<");
        pnlControlesProd.add(btnVoltarInicioProd);

        btnVoltarProd.setText("<");
        pnlBtnVoltarProd.add(btnVoltarProd);

        pnlControlesProd.add(pnlBtnVoltarProd);

        lblContador1Prod.setText("0");
        pnlControlesProd.add(lblContador1Prod);

        btnContador2Prod.setText("de");
        pnlSecundarioControlesProd.add(btnContador2Prod);

        btnContador3Prod.setText("( 0 )");
        pnlSecundarioControlesProd.add(btnContador3Prod);

        pnlControlesProd.add(pnlSecundarioControlesProd);

        btnSeguirProd.setText(">");
        pnlControlesProd.add(btnSeguirProd);

        btnUltimoProd.setText(">|");
        pnlControlesProd.add(btnUltimoProd);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(tbrAdcDelSalvarProd, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(pnlControlesProd, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 218, Short.MAX_VALUE))
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(lblDescProd)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(tfdDescProd, javax.swing.GroupLayout.DEFAULT_SIZE, 480, Short.MAX_VALUE))
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(lblPrecoProd)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(ftfPrecoProd, javax.swing.GroupLayout.PREFERRED_SIZE, 107, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                                        .addComponent(lblCodProd)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(tfdCodProd, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addComponent(lblQtdEstoqueProd))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(tfdQtdEstoqueProd, javax.swing.GroupLayout.PREFERRED_SIZE, 101, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addGap(0, 305, Short.MAX_VALUE)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(tbrAdcDelSalvarProd, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(pnlControlesProd, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblCodProd)
                    .addComponent(tfdCodProd, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblDescProd)
                    .addComponent(tfdDescProd, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(8, 8, 8)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblQtdEstoqueProd)
                    .addComponent(tfdQtdEstoqueProd, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblPrecoProd)
                    .addComponent(ftfPrecoProd, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(0, 11, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /*
         * Set the Nimbus look and feel
         */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /*
         * If Nimbus (introduced in Java SE 6) is not available, stay with the
         * default look and feel. For details see
         * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(FrmCadastroProduto.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(FrmCadastroProduto.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(FrmCadastroProduto.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(FrmCadastroProduto.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /*
         * Create and display the form
         */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new FrmCadastroProduto().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnAdcProd;
    private javax.swing.JLabel btnContador2Prod;
    private javax.swing.JLabel btnContador3Prod;
    private javax.swing.JButton btnDelProd;
    private javax.swing.JButton btnSalvarProd;
    private javax.swing.JButton btnSeguirProd;
    private javax.swing.JButton btnUltimoProd;
    private javax.swing.JButton btnVoltarInicioProd;
    private javax.swing.JButton btnVoltarProd;
    private javax.swing.JFormattedTextField ftfPrecoProd;
    private javax.swing.JLabel lblCodProd;
    private javax.swing.JLabel lblContador1Prod;
    private javax.swing.JLabel lblDescProd;
    private javax.swing.JLabel lblPrecoProd;
    private javax.swing.JLabel lblQtdEstoqueProd;
    private javax.swing.JPanel pnlBtnVoltarProd;
    private javax.swing.JPanel pnlControlesProd;
    private javax.swing.JPanel pnlSecundarioControlesProd;
    private javax.swing.JToolBar tbrAdcDelSalvarProd;
    private javax.swing.JTextField tfdCodProd;
    private javax.swing.JTextField tfdDescProd;
    private javax.swing.JTextField tfdQtdEstoqueProd;
    // End of variables declaration//GEN-END:variables
}
